package com.cunshe.service;

import com.cunshe.dao.HomeImageDao;
import com.cunshe.domain.HomeImage;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 首页
 * @author xiao
 */
@Service
public class HomeImageService {

    @Autowired
    private HomeImageDao homeImageDao;

    /** 新增 */
    public int insert(HomeImage record) {
        return homeImageDao.insert(record);
    }

    /** 删除 */
    public int delete(Long id) {
        return homeImageDao.delete(id);
    }

    /** 修改 */
    public int update(HomeImage record) {
        return homeImageDao.update(record);
    }

    /** 查询列表 */
    public List<HomeImage> list(HomeImage record) {
        PageHelper.orderBy(" screen ASC, type ASC ");
        return homeImageDao.list(record);
    }

}